﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace lucere.entity
{
    /// <summary>A field is a section of a Document.  Each field has two parts, a name and a
    /// value.  Values may be free text, provided as a String or as a Reader, or they
    /// may be atomic keywords, which are not further processed.  Such keywords may
    /// be used to represent dates, urls, etc.  Fields are optionally stored in the
    /// index, so that they may be returned with hits on the document.
    /// </summary>
    public interface IField : IAbstractField
    {
        /// <summary>Expert: change the value of this field.  See <a href="#setValue(java.lang.String)">setValue(String)</a>. </summary>
        void SetValue(TextReader value);
        /// <summary><p/>Expert: change the value of this field.  This can
        /// be used during indexing to re-use a single Field
        /// instance to improve indexing speed by avoiding GC cost
        /// of new'ing and reclaiming Field instances.  Typically
        /// a single {@link Document} instance is re-used as
        /// well.  This helps most on small documents.<p/>
        /// 
        /// <p/>Each Field instance should only be used once
        /// within a single {@link Document} instance.  See <a
        /// href="http://wiki.apache.org/lucene-java/ImproveIndexingSpeed">ImproveIndexingSpeed</a>
        /// for details.<p/> 
        /// </summary>
        void SetValue(string value);
        /// <summary>Expert: change the value of this field.  See <a href="#setValue(java.lang.String)">setValue(String)</a>. </summary>
        void SetValue(byte[] value);
        /// <summary>Expert: change the value of this field.  See <a href="#setValue(java.lang.String)">setValue(String)</a>. </summary>
        void SetValue(byte[] value, int offset, int length);
    }
}
